/*
 * Copyright 2008 Carnegie Mellon University
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *  
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, 
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package edu.cmu.lti.sepia.serializer;

import java.util.ArrayList;
import java.util.List;

import org.junit.Assert;
import org.junit.Test;

import edu.cmu.lti.sepia.infra.topic.GoldStandardObjToXml;
import edu.cmu.lti.sepia.infra.topic.model.Answer;
import edu.cmu.lti.sepia.infra.topic.model.Nugget;
import edu.cmu.lti.sepia.infra.topic.model.Topic;


public class TopicXmlSerializer {

  @Test
  public void serializeTopic() {
    List<Topic> topics = new ArrayList<Topic>();
    topics.add( new Topic(1, "TEST001", "DEFINITION", "q.src","q.trg","n.src","n.trg","note","title") );
    String srcLang = "EN";
    String trgLang = "JA";
    String taskDescription = "This is a test";
    
    @SuppressWarnings("unused")
    String xml1 = GoldStandardObjToXml.toGoldStandardXml(topics, srcLang, trgLang, taskDescription);
    //System.out.println(xml1);
    
    List<Answer> answers = new ArrayList<Answer>();
    answers.add(new Answer(1,1,"D001",0,0,"ANS1","ANS1Original","Label"));
    topics.get(0).setAnswers( answers );
    List<Nugget> nuggets = new ArrayList<Nugget>();
    nuggets.add(new Nugget(1,1,"NUGGET1",true));
    topics.get(0).setNuggets( nuggets );
    
    @SuppressWarnings("unused")
    String xml2 = GoldStandardObjToXml.toGoldStandardXml(topics, srcLang, trgLang, taskDescription);
    //System.out.println(xml2);
    
    // passes if no exception so far
    Assert.assertTrue(true);
  }
  
}
